from collections import Iterable
#迭代

info={'name':'huangxl','age':24,'gender':'男'}

for key in info:
    print(key)

for value in info.values():
    print(value)

for key,value in info.items():
    print(key,value)

#如何判断一个对象是可迭代对象呢？

print(isinstance('huangxl',Iterable))

print(isinstance(123,Iterable))

names=['huangxl','gouyd','rem','iris']

#Python内置的enumerate函数可以把一个list变成索引-元素对
for i,name in enumerate(names):
    print(i,name)

for x, y in [(1, 1), (2, 4), (3, 9)]:
    print(x, y)


